﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace _02_命令.Commands
{
    public class MyCommand : ICommand
    {
        private Action? _execute = null;
        public event EventHandler? CanExecuteChanged;

        public MyCommand(Action action) => _execute = action;
        public bool CanExecute(object? parameter) => true;

        public void Execute(object? parameter) => _execute?.Invoke();
    }
}
